package com.ruoyi.project.tool.swagger.UserController;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysBusiness;
import com.ruoyi.project.system.service.ISysBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 创业内容Controller
 *
 * @author theme
 * @date 2020-08-27
 */
@Api(description = "创业内容Controller", tags = "创业内容")
@RestController
@RequestMapping("/mobileUser/business")
public class UserBusinessController extends BaseController {
    @Autowired
    private ISysBusinessService sysBusinessService;

    /**
     * 查询创业内容列表
     */
    @ApiOperation("查询创业内容列表")
    @PostMapping("/getTypeList")
    public TableDataInfo getTypeList(@RequestBody SysBusiness sysBusiness) {
        startPage();
        List<SysBusiness> list = sysBusinessService.selectTypeSysBusinessList(sysBusiness);
        return getDataTable(list);
    }

    /**
     * 获取创业内容详细信息
     */
    @ApiOperation("获取创业内容详细信息")
    @GetMapping(value = "/{businessId}")
    public AjaxResult getInfo(@PathVariable("businessId") Long businessId) {
        return AjaxResult.success(sysBusinessService.selectSysBusinessById(businessId));
    }


}
